ostbuild: Rename build manifest to "snapshot.json"
authorColin Walters <walters@verbum.org>
Mon, 27 Feb 2012 23:57:56 +0000 (18:57 -0500)
committerColin Walters <walters@verbum.org>
Tue, 13 Mar 2012 14:39:24 +0000 (10:39 -0400)
It was confusing having two manifests.  "snapshot" matches the
jhbuild term for the same thing.

gnomeos/3.4/manifest.json
src/ostbuild/pyostbuild/builtin_build.py
src/ostbuild/pyostbuild/builtin_checkout.py
src/ostbuild/pyostbuild/builtin_chroot_compile_one.py
src/ostbuild/pyostbuild/builtin_resolve.py
src/ostbuild/pyostbuild/builtin_status.py

index 8d9544fef26f33d2e149e718a828e4f9359061fb..2deb3e9284b6a55b708018bd468fb3e41db8b0b0 100644 (file)
@@ -23,6 +23,8 @@
                "netfilter": "git:git://git.netfilter.org/",
                "cgwalters": "git:git://github.com/cgwalters/"},
 
+  "patches": {"src": "gnome:ostree"},
+
   "components": [
                {"src": "cgwalters:ginitscripts"},
 
index 124d3c11b92512367749dc46c786a6dec2b8e2ab..3497b782bb12ab477394a0c15ca0ce7dc4394cee 100755 (executable)
@@ -173,7 +173,7 @@ class OstbuildBuild(builtins.Builtin):
         f.close()
 
         args = ['ostree', '--repo=' + self.repo,
-                'commit', '-b', buildname, '-s', 'Build ' + artifact_meta['revision'],
+                'commit', '-b', buildname, '-s', 'Build',
                 '--add-metadata-string=ostbuild-buildroot-version=' + artifact_meta['buildroot-version'],
                 '--add-metadata-string=ostbuild-artifact-version=' + artifact_meta['revision'],
                 '--owner-uid=0', '--owner-gid=0', '--no-xattrs', 
@@ -233,7 +233,7 @@ class OstbuildBuild(builtins.Builtin):
         self.buildopts.shell_on_failure = args.shell_on_failure
         self.buildopts.skip_built = args.skip_built
 
-        build_manifest_path = os.path.join(self.workdir, 'manifest.json')
+        build_manifest_path = os.path.join(self.workdir, 'snapshot.json')
         self.manifest = json.load(open(build_manifest_path))
 
         self.patchdir = os.path.join(self.workdir, 'patches')
index 691cfb2279e1e62c039c48c90c2de263a04dcc8b..3aa4c50ccc0fc29bb875e6ac39635e8b620c5704 100755 (executable)
@@ -45,7 +45,7 @@ class OstbuildCheckout(builtins.Builtin):
         
         self.parse_config()
 
-        build_manifest_path = os.path.join(self.workdir, 'manifest.json')
+        build_manifest_path = os.path.join(self.workdir, 'snapshot.json')
         self.manifest = json.load(open(build_manifest_path))
 
         for component_name in args.components:
index ce699dc2feee209dc0f0d956bf470fba90e64b26..35038055a295b2ac0e8b3b99ea97813cb22dc132 100755 (executable)
@@ -39,7 +39,7 @@ class OstbuildChrootCompileOne(builtins.Builtin):
         self.parse_config()
 
         component_name = os.path.basename(os.getcwd())
-        build_manifest_path = os.path.join(self.workdir, 'manifest.json')
+        build_manifest_path = os.path.join(self.workdir, 'snapshot.json')
         self.manifest = json.load(open(build_manifest_path))
 
         if args.meta is not None:
index 7a1ec90ac9ff784aca8d0ade535a99cea8b05608..e6f680cffc4849c9185384a42b8b33daeb08d983 100755 (executable)
@@ -159,6 +159,13 @@ class OstbuildResolve(builtins.Builtin):
                 run_sync(['git', 'fetch'], cwd=mirrordir, log_initiation=False)
         else:
             fetch_components = []
+            
+        self.manifest['patches'] = self._resolve_component_meta(self.manifest['patches'])
+        patches_meta = self.manifest['patches']
+        (keytype, uri) = self._parse_src_key(patches_meta['src'])
+        mirrordir = self._ensure_vcs_mirror(patches_meta['name'], keytype, uri, patches_meta['branch'])
+        revision = buildutil.get_git_version_describe(mirrordir, patches_meta['branch'])
+        patches_meta['revision'] = revision
 
         for component in self.resolved_components:
             (keytype, uri) = self._parse_src_key(component['src'])
@@ -202,7 +209,7 @@ class OstbuildResolve(builtins.Builtin):
 
         self.manifest['components'] = self.resolved_components
 
-        out_manifest = os.path.join(self.workdir, 'manifest.json')
+        out_snapshot = os.path.join(self.workdir, 'snapshot.json')
         patchdir = os.path.join(self.workdir, 'patches')
         if not os.path.isdir(patchdir):
             os.mkdir(patchdir)
@@ -217,9 +224,9 @@ class OstbuildResolve(builtins.Builtin):
             dest = os.path.join(patchdir, patch)
             shutil.copy(src, dest)
         
-        f = open(out_manifest, 'w')
+        f = open(out_snapshot, 'w')
         json.dump(self.manifest, f, indent=4)
         f.close()
-        print "Created: %s, %d patches" % (out_manifest, len(all_patches.keys()))
+        print "Created: %s, %d patches" % (out_snapshot, len(all_patches.keys()))
         
 builtins.register(OstbuildResolve)
index 9cd49be5e0ef4623fed0afe5c44534cbca5875f5..76da628979438471b6eeb35fecac5f988bb996f5 100755 (executable)
@@ -36,7 +36,7 @@ class OstbuildStatus(builtins.Builtin):
 
     def execute(self, args):
         self.parse_config()
-        build_manifest_path = os.path.join(self.workdir, 'manifest.json')
+        build_manifest_path = os.path.join(self.workdir, 'snapshot.json')
         self.manifest = json.load(open(build_manifest_path))
 
         for architecture in self.manifest['architectures']: